<div class="heading">
    <div class="left_heading"></div>
                                
    <div class="content_heading">
        <h3>Quản lý phân quyền</h3>
    </div>
                                
    <div class="right_heading"></div>
</div><!-- End .heading -->

<div class="main_content">
    <div class="table_form">
        <form class="search_form" name="search_form" action="" method="get">
        Tìm kiếm: 
        <input class="input" type="text" name="keyword" value="<?php echo $this->searchValue; ?>" />
        <input class="button" type="submit" name="search" value="Tìm kiếm" />
        <span class="msg"><?php echo $this->errorSearch; ?></span>
        </form>
        
        <form class="list_cat_form" action="" method="post">
        <div style="float: right;">
        	<p id="add_form">Số lượng: <span class="msg"><?php echo $this->total; ?></span> phân quyền</p>
	        <?php echo $this->formSubmit('add', 'Thêm mới', array('class' => 'button', 'id' => 'add_form')); ?>
            <?php echo $this->formSubmit('refresh', 'Làm mới', array('class' => 'button', 'id' => 'add_form')); ?>
	        <?php echo $this->formSubmit('delete', 'Xóa', array('class' => 'button', 'id' => 'del_form', 'onclick' => 'return remove_alert()')); ?>
        </div>                   
        <table class="table_style">
            <tr class="head_table">
            	<td width="30px">ID</td>
                <td width="350px">Tên quyền</td>
                <td class="tools">&nbsp;</td>
                <td class="tools">&nbsp;</td>
                <td class="tools"><?php echo $this->formCheckbox('check_all', null, array('id' => 'check_all', 'onClick' => 'checkAll()')); ?></td>
            </tr>
            <?php
                if(count($this->data) > 0) :
                foreach($this->data as $value) :
            ?>
            <tr class="records">
            	<td><?php echo $value->role_id; ?></td>
                <td><?php echo $value->role_name; ?></td>
                <td><a class="edit" title="Sửa" href="<?php echo $this->baseUrl('/admin/role/edit?role_id=' . $value->role_id); ?>"></a></td>
                <td><a class="remove" title="Xóa" onclick="return remove_alert()" href="<?php echo $this->baseUrl('/admin/role/delete?role_id=' . $value->role_id); ?>"></a></td>
                <td><?php echo $this->formCheckbox('check[]', $value->role_id); ?></td>
            </tr>
            <?php 
                endforeach;
                else :
            ?>
            <tr class="records">
            	<td colspan="5">Không tìm thấy quyền hạn nào</td>
            </tr>
            <?php endif; ?>
        </table>
        </form>
    </div>
    
    <div class="pagination">
        <?php
	        $currentUrl = '/?keyword=' . $this->searchValue;
	        echo $this->paginationControl($this->data, 'Sliding', 'role/pagination_search.phtml', array('currentUrl' => $currentUrl));
        ?>
    </div>
</div><!-- End .main_content -->  